package com.marry.webservice.service;

import com.marry.webservice.entity.Demo;
import com.marry.webservice.repository.DemoRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author ml
 * @create 2017-09-13--12:02
 */
@Service
public class DemoService {

    @Resource
    DemoRepository demoRepository;


    public void save(Demo demo){

        demoRepository.save(demo);


    }

    public Demo getById(Long id){

        return demoRepository.findOne(id);
    }

    public Demo save2(Demo demo){
        return demoRepository.save(demo);
    }
}
